﻿
Imports System.Data
Imports VSModel
Imports Cls_Common
Imports SecurityService

Partial Class FrontEnd_Control_Menu_TopMenu
    Inherits System.Web.UI.UserControl
    Public curURL As String = ""
    Dim level As String = 0
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not Page.IsPostBack Then
            curURL = Request.Url.AbsoluteUri.ToString.Replace(MainDomain, "").Split("/")(0).Replace(".html", "") & ".html"

            Dim lstNode As New DataSet
            lstNode.ReadXml(MapPath("../../../xml/HeaderMenu.xml"))
            With rptMenu
                .DataSource = lstNode.Tables("Node")
                .DataBind()
            End With
        End If
    End Sub
    Protected Sub rptMenu_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.RepeaterItemEventArgs) Handles rptMenu.ItemDataBound

        Dim ltrTitle As Literal
        ltrTitle = e.Item.FindControl("ltrTitle")
        ltrTitle.Text = "<li class='current'><a href='" & MainDomain & e.Item.DataItem("URL") & "'><span>" & e.Item.DataItem("Title") & "</span></a></li>"
        ltrTitle.Text = "<li><a href='" & MainDomain & e.Item.DataItem("URL") & "'><span class=""menu-left""></span><span class=""menu-mid"">" & _
                            e.Item.DataItem("Title") & "</span><span class=""menu-right""></span></a></li>"
    End Sub

End Class
